package cn.cloud.all.security.authentication.event;

import cn.cloud.all.security.core.Authentication;
import cn.cloud.all.security.core.AuthenticationException;
import org.springframework.util.Assert;

public abstract class AbstractAuthenticationFailureEvent extends AbstractAuthenticationEvent {

    private final AuthenticationException exception;

    public AbstractAuthenticationFailureEvent(Authentication authentication, AuthenticationException exception) {
        super(authentication);
        Assert.notNull(exception, "AuthenticationException is required");
        this.exception = exception;
    }

    public AuthenticationException getException() {
        return exception;
    }
}
